package com.hyk.learning.config;

import lombok.*;

/**
 * @className: RpcServiceConfig
 * @author: hyk199710
 * @description: TODO
 * @date: 2024/5/10 21:15
 */
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
@Builder
@ToString
public class RpcServiceConfig {

    private String version = "";

    private String group = "";

    private Object service;

    private int weight;

    private long warmupTS;

    private int timeout;

    private boolean canRetry;

    public String getRpcServiceName() {
        return this.getServiceName() + this.getGroup() + this.getVersion();
    }

    public String getServiceName() {
        return this.service.getClass().getInterfaces()[0].getCanonicalName();
    }
}
